package org.example.mytest.control;

import org.example.mytest.entity.Myclass;
import org.example.mytest.entity.Score;
import org.example.mytest.mapper.MyclassMapper;
import org.example.mytest.mapper.ScoreMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class ClassControler
{
    @Autowired
    private MyclassMapper myclassMapper;
    @GetMapping("/class/query0")
    public List query2() {
        List<Myclass> list = myclassMapper.selectList(null);
        return list;
    }
    @GetMapping("/selectById/{userId}")
    public Myclass selectById(@PathVariable("userId")Integer userId)
    {
        return myclassMapper.selectById(userId);
    }

    @GetMapping("/findById/{classId}")
    public Myclass findById(@PathVariable("studentid")Integer studentid)
    {
        return myclassMapper.findby(studentid);
    }

}
